package cn.online.service;

import cn.online.dao.AdminDao;
import cn.online.model.Admin;

public class AdminService {
	private AdminDao adminDao;

	public void setAdminDao(AdminDao adminDao) {
		this.adminDao = adminDao;
	}
	
	public Admin get(String username,String password){
		return adminDao.get(username, password);
	}
	
	public void changePassword(Integer id,String newPassword){
		Admin admin = adminDao.findById(id);
		if(admin!=null){
			admin.setApassword(newPassword);
			adminDao.update(admin);
		}
	}
}
